]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
ShellAppSystem: handle desktop files with capital letters
authorGiovanni Campagna <gcampagna@src.gnome.org>
Sun, 18 Aug 2013 16:26:37 +0000 (18:26 +0200)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Sun, 18 Aug 2013 20:05:44 +0000 (22:05 +0200)
This is needed to handle applications that are converted to
reverse dns notation, if their application ID includes capital
letters (as it is often the case for DBus names)

https://bugzilla.gnome.org/show_bug.cgi?id=706252

src/shell-app-system.c

index 7f43bd4b03bebd1bc56c19544b27cfca34ade359..ad27ade85be66411fc6294a31ff1a3303316164c 100644 (file)
@@ -559,6 +559,20 @@ shell_app_system_lookup_desktop_wmclass (ShellAppSystem *system,
   if (wmclass == NULL)
     return NULL;
 
+  /* First try without changing the case (this handles
+     org.example.Foo.Bar.desktop applications)
+
+     Note that is slightly wrong in that Gtk+ would set
+     the WM_CLASS to Org.example.Foo.Bar, but it also
+     sets the instance part to org.example.Foo.Bar, so we're ok
+  */
+  desktop_file = g_strconcat (wmclass, ".desktop", NULL);
+  app = shell_app_system_lookup_heuristic_basename (system, desktop_file);
+  g_free (desktop_file);
+
+  if (app)
+    return app;
+
   canonicalized = g_ascii_strdown (wmclass, -1);
 
   /* This handles "Fedora Eclipse", probably others.